import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUi from 'element-ui'
import axios from 'axios'
import 'element-ui/lib/theme-chalk/index.css'

import utils from './common/js/utils.js'
import verify from './common/js/verify.js'
import * as API from './common/js/api.js'
import mixin from '@/common/js/mixin.js'
import Filter from '@/common/js/filter.js'
import store from './store'

import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

Object.keys(Filter).forEach(key => Vue.filter(key, Filter[key]))
Vue.mixin(mixin)

Vue.use(ElementUi)


if(location.href.indexOf('https')!=-1){
	// Vue.prototype.$domain = 'https://www.henanmaotong.com/index.php'
	// Vue.prototype.$baseUrl = 'https://www.henanmaotong.com'

	Vue.prototype.$domain = 'https://yl.lizuzhe.com'
	Vue.prototype.$baseUrl = 'https://yl.lizuzhe.com'
	
}else{
	Vue.prototype.$domain = 'http://www.qrcode.com'
	Vue.prototype.$baseUrl = 'http://www.qrcode.com'
}
Vue.prototype.$domain = 'https://yl.lizuzhe.com'
	Vue.prototype.$baseUrl = 'https://yl.lizuzhe.com'
  
Vue.prototype.axios	= axios
// 拖拽
import VueDND from 'awe-dnd'

Vue.use(VueDND)


const obj = {
  api:API,
  utils,
  verify
}

for (const key in obj) {
  Object.defineProperty(Vue.prototype, `$${key}`, {
    get: () => obj[key]
  })
}
NProgress.configure({
easing: 'ease', // 动画方式
speed: 600, // 递增进度条的速度
showSpinner: true, // 是否显示加载ico
trickleSpeed: 200, // 自动递增间隔
minimum: 0.3 // 初始化时的最小百分比
})

router.beforeEach((to,from,next) => {
  NProgress.start() 
  next()
})
router.afterEach(() => {
  NProgress.done()
})


Vue.config.productionTip = false
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
